clear all
close all

load('Cstim_f.mat')
load('subject_specification.mat')
scale_factors = [0.0085 0.0738 0.0479 0.0283];

for ss = 1:8
    for distance = 1:4 % distance:1 (far), distance:2 (10 cm), distance:3 (17 cm), distance:3 (30 cm)
        thr_pre_t(ss,distance) = Training.pre_size{ss,distance}(end,1)*scale_factors(distance);
        thr_post_t(ss,distance) = Training.post_size{ss,distance}(end,1)*scale_factors(distance);
        
        rt_pre_t(ss,distance) = median(Training.pre_rt{ss,distance}(Training.pre_rt{ss,distance}<100));
        rt_post_t(ss,distance) = median(Training.post_rt{ss,distance}(Training.post_rt{ss,distance}<100));
        
        
        thr_pre_ct(ss,distance) = ControlTraining.pre_size{ss,distance}(end,1)*scale_factors(distance);
        thr_post_ct(ss,distance) = ControlTraining.post_size{ss,distance}(end,1)*scale_factors(distance);
       
        
        rt_pre_ct(ss,distance) = median(ControlTraining.pre_rt{ss,distance}(ControlTraining.pre_rt{ss,distance}<100));
        rt_post_ct(ss,distance) = median(ControlTraining.post_rt{ss,distance}(ControlTraining.post_rt{ss,distance}<100));
        
        
        thr_pre_c(ss,distance) = Control.pre_size{ss,distance}(end,1)*scale_factors(distance);
        thr_post_c(ss,distance) = Control.post_size{ss,distance}(end,1)*scale_factors(distance);
        
        rt_pre_c(ss,distance) = median(Control.pre_rt{ss,distance}(Control.pre_rt{ss,distance}<100));
        rt_post_c(ss,distance) = median(Control.post_rt{ss,distance}(Control.post_rt{ss,distance}<100));
    end
    
end

